home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / p96pcq.lha / Picasso96PCQ / Examples / RequestModeID.p < prev    next >
Encoding:
Text File  |  1997-07-18  |  2.5 KB  |  92 lines

  1. Program RequestID;
  2.  
  3. {
  4.     PCQ-Version des Picasso96-Demoprogrammes
  5.  
  6.     in Pascal übersetzt von Andreas Neumann
  7. }
  8.  
  9. { ***********************************************************************
  10.   * This is example shows how to use p96RequestModeIDTagList()
  11.   *
  12.   * tabt (Sat Dec 28 03:44:35 1996)
  13.   *********************************************************************** }
  14.  
  15. {$I "Include:exec/memory.i" }
  16. {$I "Include:exec/libraries.i" }
  17. {$I "Include:dos/RDArgs.i" }
  18. {$I "Include:libraries/dosextens.i" }
  19. {$I "Include:graphics/graphics.i" }
  20. {$I "Include:graphics/displayinfo.i" }
  21. {$I "Include:intuition/intuition.i" }
  22. {$I "Include:utils/stringlib.i" }
  23. {$I "Include:p96/Picasso96.i" }
  24.  
  25. Const
  26.     gfxname     :   String = "graphics.library";
  27.     WindowTitle :   String = "RequestModeID Test";
  28.     template    :   String = "Width=W/N,Height=H/N,Depth=D/N";
  29.  
  30.     vecarray    :   Array[0..2] of Address = (Nil, Nil, Nil);
  31.  
  32. Var
  33.     ptags       :   Array [0..32] Of TagItem;
  34.     width,
  35.     height,
  36.     depth,
  37.     DisplayID   :   Integer;
  38.     dim         :   DimensionInfo;
  39.     rda         :   RDArgsPtr;
  40.  
  41.  
  42. Begin
  43.  width:=640;
  44.  height:=480;
  45.  depth:=15;
  46.  
  47.  rda:=ReadArgs (template,Adr(vecarray),Nil);
  48.  If rda<>Nil Then
  49.  Begin
  50.   If vecarray[0]<>NIL then CopyMem(vecarray[0],adr(width),4);
  51.   If vecarray[1]<>NIL then CopyMem(vecarray[1],adr(height),4);
  52.   If vecarray[2]<>NIL then CopyMem(vecarray[2],adr(depth),4);
  53.   FreeArgs(rda);
  54.  End;
  55.  
  56.  GfxBase:=OpenLibrary (gfxname,0);
  57.  If GfxBase<>Nil Then
  58.  Begin
  59.   P96Base:=OpenLibrary (P96Name,2);
  60.   If P96Base<>Nil Then
  61.   Begin
  62.    ptags[0].ti_Tag:=P96MA_MinWidth;
  63.    ptags[0].ti_Data:=width;
  64.    ptags[1].ti_Tag:=P96MA_MinHeight;
  65.    ptags[1].ti_Data:=height;
  66.    ptags[2].ti_Tag:=P96MA_MinDepth;
  67.    ptags[2].ti_Data:=depth;
  68.    ptags[3].ti_Tag:=P96MA_WindowTitle;
  69.    ptags[3].ti_Data:=Integer(WindowTitle);
  70.    ptags[4].ti_Tag:=P96MA_FormatsAllowed;
  71.    ptags[4].ti_Data:=(RGBFF_CLUT or RGBFF_R5G6B5 or RGBFF_R8G8B8 or RGBFF_A8R8G8B8);
  72.    ptags[5].ti_Tag:=TAG_DONE;
  73.    DisplayID:=p96RequestModeIDTagList (Adr(ptags[0]));
  74.  
  75.    Writeln ("DisplayID:", DisplayID);
  76.    If DisplayID<>INVALID_ID Then
  77.    Begin
  78.     If GetDisplayInfoData(Nil, Adr(dim),SizeOf(DimensionInfo),DTAG_DIMS,DisplayID)<>0 Then
  79.      Writeln ("Dimensions: ",dim.Nominal.MaxX-dim.Nominal.MinX+1,"x",dim.Nominal.MaxY-dim.Nominal.MinY+1,"x",dim.MaxDepth)
  80.     Else
  81.      Writeln ("No Dimensioninfo.");
  82.    End
  83.    Else
  84.     Writeln ("DisplayID invalid.");
  85.    CloseLibrary(P96Base);
  86.   End
  87.   Else
  88.    Writeln ("Unable to open Picasso96 library.");
  89.   CloseLibrary (GfxBase);
  90.  End;
  91. End.
  92.